using System;
using System.Collections.Generic;
using Library;
using Library.Util;
using NHibernate;

namespace Library.Persistence.Cloud.Dao
{
	public class CloudFirmaAyarDao : BaseEntity
	{
		private readonly string fromHql = " from CloudFirmaAyar as t ";
		public void Insert(CloudFirmaAyar dto)
		{
			BasePersistence.Insert(dto);
		}

		public void Update(CloudFirmaAyar dto)
		{
			BasePersistence.Update(dto);
		}

		public void Delete(CloudFirmaAyar dto)
		{
			BasePersistence.Delete(dto);
		}

		public void Delete(int firmaAyarId)
		{
			CloudFirmaAyar dto = new CloudFirmaAyar();
			dto.FirmaAyarId = firmaAyarId;
			Delete(dto);
		}

		public CloudFirmaAyar Get(int firmaAyarId, LockMode lockMode)
		{
			return Get<CloudFirmaAyar>(firmaAyarId, lockMode);
		}

		public List<CloudFirmaAyar> FindAll()
		{
			return Find<CloudFirmaAyar>(fromHql, LockMode.Read);
		}

		public List<CloudFirmaAyar> FindAll(string orderStatement)
		{
			return Find<CloudFirmaAyar>(fromHql + " ORDER BY " + orderStatement, LockMode.Read);
		}

	}
}
